<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core" template="/sistema/template/template.xhtml">

	<ui:param name="nomeTela" value="Tempo do Atleta" />

	<ui:define name="corpo">

		<p:spacer height="18" width="100%" />

		<p:panel>

			<h:panelGrid style="text-align:left;" width="100%">
				<p:outputLabel value="#{nomeTela}" styleClass="subtitulo" />
			</h:panelGrid>

			<p:spacer height="20" width="100%" />

			<h:panelGrid columns="4" width="100%">

				<p:outputLabel value="Atletas" />

				<p:selectOneMenu>
					<f:selectItem itemLabel="Atleta A" itemValue="0" />
					<f:selectItem itemLabel="Atleta B" itemValue="1" />
					<f:selectItem itemLabel="Atleta C" itemValue="2" />
					<f:selectItem itemLabel="Atleta D" itemValue="3" />
				</p:selectOneMenu>

				<p:outputLabel value="Exercicio" />

				<p:selectOneMenu>
					<f:selectItem itemLabel="2011" itemValue="0" />
					<f:selectItem itemLabel="2012" itemValue="1" />
					<f:selectItem itemLabel="2013" itemValue="2" />
					<f:selectItem itemLabel="2014" itemValue="3" />
				</p:selectOneMenu>

				<p:outputLabel value="Modalidade" />

				<p:selectOneMenu>
					<f:selectItem itemLabel="Livre ou Crawl" itemValue="0" />
					<f:selectItem itemLabel="Costas" itemValue="1" />
					<f:selectItem itemLabel="Peito" itemValue="2" />
					<f:selectItem itemLabel="Borboleta" itemValue="3" />
					<f:selectItem itemLabel="Revezamento" itemValue="4" />
				</p:selectOneMenu>

				<p:outputLabel value="Evento" />

				<p:selectOneMenu>
					<f:selectItem itemLabel="Treinamento" itemValue="0" />
					<f:selectItem itemLabel="#{label.competicao} 1" itemValue="1" />
					<f:selectItem itemLabel="#{label.competicao} 2" itemValue="2" />
					<f:selectItem itemLabel="#{label.competicao} 3" itemValue="3" />
				</p:selectOneMenu>

				<p:outputLabel value="Percurso" />

				<p:selectOneMenu>
					<f:selectItem itemLabel="25m" itemValue="0" />
					<f:selectItem itemLabel="50m" itemValue="1" />
					<f:selectItem itemLabel="100m" itemValue="2" />
				</p:selectOneMenu>

				<p:outputLabel value="Categoria" />

				<p:selectOneMenu>
					<f:selectItem itemLabel="Mirim I" itemValue="0" />
					<f:selectItem itemLabel="Mirim II" itemValue="1" />
					<f:selectItem itemLabel="Infantil I" itemValue="2" />
					<f:selectItem itemLabel="Infantil II" itemValue="3" />
				</p:selectOneMenu>


			</h:panelGrid>

			<p:spacer width="100%" height="20" />
			<p:spacer width="530" height="0" />
			<p:commandButton value="Registrar Tempo" onclick="PF('pop').show();" />

		</p:panel>


		<p:tabView id="tabview1" dynamic="true" activeIndex="#{tempoMB.activeTab}" styleClass="panelInterno">

			<p:ajax event="tabChange" listener="#{tempoMB.onTabChange}" update="tabview1" />

			<p:tab title="Jan.">


				<p:dataTable var="item" value="#{tempoMB.arrayValue}" rowIndexVar="re">

					<p:columns var="colunm" value="#{tempoMB.array}" columnIndexVar="index" headerText="#{colunm}"
						styleClass="#{tempoMB.getStyle(re, index)}">
						<p:outputLabel value="#{item[index]}" />
					</p:columns>

				</p:dataTable>

				<p:spacer width="100%" height="50" />

			</p:tab>


			<p:tab title="Fev.">

				<p:dataTable var="item" value="#{tempoMB.arrayValue}" rowIndexVar="re">

					<p:columns var="colunm" value="#{tempoMB.array}" columnIndexVar="index" headerText="#{colunm}"
						styleClass="#{tempoMB.getStyle(re, index)}">
						<p:outputLabel value="#{item[index]}" />
					</p:columns>

				</p:dataTable>

				<p:spacer width="100%" height="50" />

			</p:tab>
			<p:tab title="Mar."></p:tab>
			<p:tab title="Abr."></p:tab>
			<p:tab title="Mai."></p:tab>
			<p:tab title="Jun."></p:tab>
			<p:tab title="Jul."></p:tab>
			<p:tab title="Ago."></p:tab>

			<p:tab title="Set.">
			</p:tab>
			<p:tab title="Out.">
			</p:tab>
			<p:tab title="Nov.">
			</p:tab>
			<p:tab title="Dez.">
			</p:tab>

			<p:tab title="Apurado">

				<h:panelGrid style="text-align:left;" width="90%">
					<p:outputLabel value="Melhores Tempos" styleClass="subtitulo" />
				</h:panelGrid>

				<p:spacer height="20" width="100%" />

				<p:dataTable value="#{tempoMB.colectionMelhor}" var="item" style="text-align:left;" width="90%">

					<f:facet name="header">
						<p:outputLabel value="Melhores Tempos de 2011" />
					</f:facet>

					<p:column headerText="Mes">
						<p:outputLabel value="#{item[0]}" />
					</p:column>

					<p:column headerText="Data">
						<p:outputLabel value="#{item[1]}" />
					</p:column>

					<p:column headerText="Tempo">
						<p:outputLabel value="#{item[2]}" />
					</p:column>


				</p:dataTable>

			</p:tab>

		</p:tabView>


		<p:dialog id="popup" widgetVar="pop" width="400" header="Registro" resizable="false" modal="true" closeOnEscape="true">

			<h:panelGrid style="text-align:left;" width="100%">
				<p:outputLabel value="Registrar Tempo" styleClass="subtitulo" />
			</h:panelGrid>

			<p:spacer width="100%" height="20" />

			<h:panelGrid columns="2" cellspacing="10">

				<p:outputLabel value="Atletas" />

				<p:selectOneMenu>
					<f:selectItem itemLabel="Atleta A" itemValue="0" />
					<f:selectItem itemLabel="Atleta B" itemValue="1" />
					<f:selectItem itemLabel="Atleta C" itemValue="2" />
					<f:selectItem itemLabel="Atleta D" itemValue="3" />
				</p:selectOneMenu>

				<p:outputLabel value="Modalidade" />

				<p:selectOneMenu>
					<f:selectItem itemLabel="Livre ou Crawl" itemValue="0" />
					<f:selectItem itemLabel="Costas" itemValue="1" />
					<f:selectItem itemLabel="Peito" itemValue="2" />
					<f:selectItem itemLabel="Borboleta" itemValue="3" />
					<f:selectItem itemLabel="Revezamento" itemValue="4" />
				</p:selectOneMenu>

				<p:outputLabel value="Evento" />

				<p:selectOneMenu>
					<f:selectItem itemLabel="Treinamento" itemValue="0" />
					<f:selectItem itemLabel="Competicao 1" itemValue="1" />
					<f:selectItem itemLabel="Competicao 2" itemValue="2" />
					<f:selectItem itemLabel="Competicao 3" itemValue="3" />
				</p:selectOneMenu>

				<p:outputLabel value="Percurso" />

				<p:selectOneMenu>
					<f:selectItem itemLabel="25m" itemValue="0" />
					<f:selectItem itemLabel="50m" itemValue="1" />
					<f:selectItem itemLabel="100m" itemValue="2" />
				</p:selectOneMenu>


				<p:outputLabel value="Categoria" />

				<p:selectOneMenu>
					<f:selectItem itemLabel="Mirim I" itemValue="0" />
					<f:selectItem itemLabel="Mirim II" itemValue="1" />
					<f:selectItem itemLabel="Infantil I" itemValue="2" />
					<f:selectItem itemLabel="Infantil II" itemValue="3" />
				</p:selectOneMenu>


				<p:outputLabel value="Data" />
				<p:inputText style="width: 243px;" value="30/11/2013" />

				<p:outputLabel value="Tempo" />
				<p:inputText id="date" style="width: 243px;">
				</p:inputText>

				<p:column></p:column>

				<h:panelGrid style="text-align: right;">
					<p:spacer width="240" height="10" />
					<p:commandButton value="Registrar" />
				</h:panelGrid>

			</h:panelGrid>
		</p:dialog>


	</ui:define>

</ui:composition>